package top.ahzy.seobench.controller;

import cn.hutool.http.HttpStatus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.ahzy.seobench.result.Result;
import top.ahzy.seobench.task.ConfigDataTask;


@Api(tags = "DDNS")
@RestController
@RequestMapping("/ddns")
public class DDNSCountroller {

    @Autowired
    ConfigDataTask configDataTask;

    @PostMapping("/checkAndUpdateIP")
    @ApiOperation(value = "动态修改阿里云ip", notes = "")
    public Result<String> geiIpv6() throws Exception {
        configDataTask.checkAndUpdateIP();
        return new Result<>(HttpStatus.HTTP_OK, Result.success);
    }
}